package org.example;

import java.util.Date;

public class User {
    protected int id;
    protected String username, password, userType, telephone;
    protected Date registerTime;
    protected boolean needChangePassword;

    public User(int id, String username, String password, String userType,
                String telephone, Date registerTime, boolean needChangePassword) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.userType = userType;
        this.telephone = telephone;
        this.registerTime = registerTime;
        this.needChangePassword = needChangePassword;
    }

    public void display() {
        System.out.printf("ID:%d 用户名:%s 类型:%s 电话:%s 注册:%s%n",
                id, username, userType, telephone, registerTime);
    }

    // Getters
    public int getId() { return id; }
    public String getUsername() { return username; }
    public String getPassword() { return password; }
    public String getUserType() { return userType; }
    public String getTelephone() { return telephone; }
    public Date getRegisterTime() { return registerTime; }
    public boolean isNeedChangePassword() { return needChangePassword; }

    // Setters
    public void setPassword(String p) { password = p; }
    public void setNeedChangePassword(boolean b) { needChangePassword = b; }
    public void setTelephone(String tel) { this.telephone = tel; }
    public void setUserType(String type) { this.userType = type; }
}